package org.zch.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.zch.common.ApiResult;
import org.zch.entity.po.PublicBeanPO;
import org.zch.entity.po.TipWorksPO;
import org.zch.entity.po.WorksPO;
import org.zch.service.TipWorksService;

/**
 * 作品举报
 */
@RestController
@RequestMapping("/tipWorks")
@Api(tags = "作品举报")
public class TipWorkController {

    @Autowired
    private TipWorksService tipWorksService;

    /**
     * 获取举报列表*/
    @ApiOperation(value = "获取举报列表", notes = "获取举报列表")
    @GetMapping("/getTipList")
    public ApiResult getTipList(){
        return ApiResult.ok(tipWorksService.getTipList());
    }

    /**
     * 添加举报内容*/
    @ApiOperation(value = "添加举报内容", notes = "添加举报内容")
    @PostMapping("/addTip")
    public ApiResult addTip(@RequestBody TipWorksPO tipWorksPO){
        return ApiResult.ok(tipWorksService.addTip(tipWorksPO));
    }


    /**
     * 根据id删除内容*/
    @ApiOperation(value = "根据id删除内容", notes = "根据id删除内容")
    @PostMapping("/deleteTip")
    public ApiResult deleteTip(@RequestParam("id") Integer id){
        return ApiResult.ok(tipWorksService.deleteTip(id));
    }

}
